#ifndef TCP_SERVER_H
#define TCP_SERVER_H
#include "socket_common.h"
#include "tcp_connection.h"
namespace eGear{


class TcpServer{
	// A easy-to-use interface to socket api.
public:
	TcpServer(char *_addr, int _port, int _backlog);
	~TcpServer();
	int startUp();
	int shutDown();
	TcpConnection *getNewClient();
	int setAddr(char *_addr);
	void setPort(int _port) { port = _port; };
	void setBacklog(int _backlog) { backlog = _backlog; };
private:
	int socketfd;
	char *addr;
	int max_addr_len;
	int port;
	int backlog;
	// TODO
};

}
#endif /* TCP_SERVER_H */
